import request from "../request/request";

//获取全部用户
export function getAllUser() {
  return request().get("/api/user/findUserList")
}

//删除用户
export function deleteUserById (id) {
  return request().delete(`/api/user/delete/${id}`);
}

//添加用户
export function addUser(userObj) {
  return request().post("/api/user/insert",{
    avatar:userObj.avatar,
    password:userObj.password,
    username:userObj.username,
    type:0,
  })
}

//用户登录
export function userLogin(userObj) {
  return request().post("/api/user/login",{
    username:userObj.username,
    password:userObj.password,
  })
}

//用户更新
export function updateUser(newUserObj) {
  return request().post("/api/user/update",{
    id:newUserObj.id,
    avatar:newUserObj.avatar,
    password:newUserObj.password,
  })
}


